package com.nacosdemo.nacosdemo;

import com.nacosdemo.api.TestService;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.web.client.RestTemplate;

@SpringBootApplication(scanBasePackages = "com.nacosdemo")
@EnableDiscoveryClient
@EnableFeignClients(basePackageClasses = TestService.class)
public class NacosconsumerApplication {

    public static void main(String[] args) {
        SpringApplication.run(NacosconsumerApplication.class, args);
    }

    @LoadBalanced
    @Bean
    public RestTemplate restTemplate() {
        return new RestTemplate();
    }

}
